package com.maychat.service;

import com.maychat.exception.BusinessException;
import com.maychat.pojo.ChatMessage;
import com.maychat.pojo.UserInfoToken;
import com.maychat.pojo.extended.Message;
import org.springframework.web.multipart.MultipartFile;

import java.io.FileNotFoundException;
import java.io.IOException;

public interface ChatMessageService {
    Message<?> saveMessage(ChatMessage chatMessage, UserInfoToken tokenObj) throws BusinessException;

    void saveMessage4Robot(String userId, String userMsg);
    void saveMessage4RobotAsync(String userId, String userMsg);

    void uploadFile(String userId, Long messageId, MultipartFile file, MultipartFile cover) throws BusinessException,
            IOException;

    Object[] download(UserInfoToken tokenObj, Long id, Boolean wantCover) throws BusinessException, FileNotFoundException;
}
